import request from '@/utils/request'

const api_name = '/serviceEdu/chapter'

export default {
  // 根据课程id查询章节小结信息
  getAllChapterVideo(courseId) {
    return request({
      url: `${api_name}/getChapterVideo/${courseId}`,
      method: 'get'
    })
  },
  // 新增章节
  save(chapter){
    return request({
      url: `${api_name}/addChapter`,
      method: 'post',
      data: chapter
    })
  },
  // 根据id查询章节
  getById(courseId){
    return request({
      url: `${api_name}/getChapterById/${courseId}`,
      method: 'get'
    })
  },
  // 根据id修改章节信息
  updateById(chapter){
    return request({
      url: `${api_name}/updateChapter/${chapter.id}`,
      method: 'put',
      data: chapter
    })
  },
  // 根据id删除章节
  removeById(courseId){
    return request({
      url: `${api_name}/removeChapter/${courseId}`,
      method: 'delete'
    })
  }



}